#ifndef DLLQLSLOG_H
#define DLLQLSLOG_H

#include <QObject>
#include <QMutex>
#include <QString>

#include "dllQLsLog_global.h"
#include "../dllQsLog/QsLog.h"

class DLLQLSLOG_EXPORT DllQLsLog : public QObject
{
	Q_OBJECT
public:
	DllQLsLog();

	/* 单例模式：懒汉式 + 双检锁 */
	static DllQLsLog &GetInstance();
	/* 销毁实例 */
	static void DestroyInstance();
	/* 设置日志输出文件 */
	void SetLogPath(const QString &logPath);
	/* 设置日志输出界面 */
	void SetLogWindow(QObject *window);

private:
	QString m_logPath;								/* 日志文件路径 */
	QObject *m_window;								/* 输出窗口，支持多个 */

	static QMutex m_instanceMutex;					/* 实例锁 */
	static DllQLsLog *m_instance;					/* 实例 */
};

#endif // DLLQLSLOG_H
